<template>
  <div class="form-box">
    <div class="form-title">填写企业法人代表信息</div>
    <div class="form-content-box">
      <el-form
        :model="form"
        label-width="auto"
        style="max-width: 600px; margin: auto"
      >
        <el-form-item label="您的身份为">
          <el-radio-group v-model="form.resource" style="width: 100%">
            <div class="radio-border">
              <el-radio value="1">有限责任公司</el-radio>
              <div class="radio-txt">
                您本人为该企业的负责人，能够代表企业行使
              </div>
            </div>
            <div class="radio-border">
              <el-radio value="2">个体工商户</el-radio>
              <div class="radio-txt">
                您本人被企业授权，能够代表企业处理事务
              </div>
            </div>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="企业法人代表国籍">
          <el-select v-model="form.region" placeholder="请选择企业法人代表国籍">
            <el-option label="中国" value="1" />
            <el-option label="日本" value="2" />
          </el-select>
        </el-form-item>
        <el-form-item label="证件类型">
          <el-radio-group v-model="form.cardType">
            <el-radio value="1">身份证</el-radio>
            <el-radio value="2">护照</el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="上传身份证正背面">
          <el-upload
            class="upload-demo"
            drag
            action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
            multiple
          >
            <img src="../../assets/imgs/real-name-img/sfzzm.png" alt="" />
            <div class="el-upload__text">
              选择<em>身份证正面</em>将文件拖拽至此或者 <em>点击上传</em>
            </div>
          </el-upload>
          <el-upload
            class="upload-demo"
            drag
            action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
            multiple
          >
            <img src="../../assets/imgs/real-name-img/sfzbm.png" alt="" />
            <div class="el-upload__text">
              选择<em>身份证背面</em>将文件拖拽至此或者 <em>点击上传</em>
            </div>
            <template #tip>
              <div class="el-upload__tip">
                <div>1.请上传证件原件照片，不支持扫描件</div>
                <div>
                  2.请确保证件信息清晰、完整，照片需包含证件四角，无反光
                </div>
                <div>3.支持JPG、JPEG、PNG格式</div>
                <div>4.文件大小不超过20MB</div>
              </div>
            </template>
          </el-upload>
        </el-form-item>
        <el-form-item label="法人代表姓名">
          <el-input v-model="form.name" />
        </el-form-item>
        <el-form-item label="法人代表证件号码">
          <el-input v-model="form.id" />
        </el-form-item>
        <el-form-item>
          <div class="btn-box">
            <el-button type="primary" @click="prev">上一步</el-button>
            <el-button>保存</el-button>
            <el-button type="primary" @click="next">下一步</el-button>
          </div>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
  <script setup>
import { reactive, defineEmits } from "vue";
const emit = defineEmits();

// do not use same name with ref
const form = reactive({
  name: "",
  region: "",
  date1: "",
  date2: "",
  delivery: false,
  type: [],
  resource: "",
  desc: "",
  id: "",
  cardType: "",
});

const next = () => {
  console.log("submit!");
};
</script>
  <style lang="less" scoped>
.form-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .form-title {
    font-family: PingFangSC, PingFang SC;
    font-weight: 500;
    font-size: 1.5rem;
    color: #000000;
    margin: 1.5rem 0;
  }
}
.upload-demo {
  width: 100%;
}
.radio-border {
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
  border: 1px solid #cca46b;
  border-radius: 12px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  .radio-txt {
    font-family: PingFangSC, PingFang SC;
    font-weight: 400;
    font-size: 12px;
    color: #6d7278;
  }
}
.btn-box {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 100px;
  box-sizing: border-box;
}
.el-upload__tip {
  font-family: PingFangSC, PingFang SC;
  font-weight: 400;
  font-size: 14px;
  color: #cca46b;
  line-height: 28px;
  text-align: left;
  font-style: normal;
}
</style>